package org.javanum.number;


/**
 * <p>Represents an abstract Ring</p>
 * 
 * <p>A <i>Ring</i> is a set {@code S}, together with two operations, {@code +} 
 * and {@code *}, which satisfy the following:</p>
 * 
 * <p>1. <i>Group under {@code +}</i>
 * 		{@code S} together with {@code +} form a {@link Group}</p>
 * <p>2. <i>Associativity of *:</i> for any elements {@code a,b}, and {@code c} in 
 * 		{@code S}, {@code (a*b)*c=a*(b*c)}</p>
 * <p>3. <i>Closure:</i> for any two elements {@code a} and {@code b}, {@code a*b} is
 * also in {@code S}</p>
 * <p>4. <i>Distributivity of *:</i> for any elements {@code a,b} and {@code c},
 *  then {@code a*(b+c) = a*b+a*c}</p>
 *  
 * <p>Note that some definitions of Rings also require that there be a multiplicative
 * identity element. However, this interface does not require such an element to exist,
 * so as to take the broadest possible definition. For more information, see Gallian[1],
 * Herstein[2], or any textbook on Abstract Algebra.</p>
 * 
 * @author Scott Fines
 * Date: Oct 22, 2009
 *
 * @param <T> The ring element which can be processed. Since ring operations need
 * only be applicable to elements within the Ring itself, this type parameter specifies
 * what group a particular elements belongs to in a type-safe manner.
 */
public interface Ring<T extends Ring<T>> extends Group<T> {
	
	/**
	 * <p>Multiplies {@code this} by the element {@code value}.</p>
	 * 
	 * <p>Note that there are NO commutativity requirements placed on the
	 * multiplication operation. Therefore, {@code this*value !=value*this}for 
	 * all Rings. Rings which do satisfy this rule should clearly indicate so.</p>
	 * 
	 * @param value the element to be multiplied
	 * @return the result of the computation {@code this*value}
	 */
	public T multiply(T value);

}
